﻿@model PagedTopicContainer
@using PopForums.Extensions;
@using PopForums.Models

@{
	ViewBag.Title = ViewBag.PostUserName + "'s " + PopForums.Resources.Posts;
	Layout = "~/Areas/PopForums/Views/Shared/PopForumsMaster.mobile.cshtml";
}

@Html.PagerLinksMobile(Url, "Account", "Posts", Model.PagerContext)

@helper TopicLink(Topic topic)
	{
	if (this.GetUserFromViewData() == null)
	{
		@Url.Action("Topic", "Forum", new { id = topic.UrlName, page = 1 })
	}
	else
	{
		@Url.Action("GoToNewestPost", "Forum", new { id = topic.TopicID })
	}
}

<ul class="pf-list pf-container">
	@foreach (var topic in Model.Topics)
	{
		<li class="pf-list-item@(topic.IsDeleted ? Html.Raw(" deletedItem") : Html.Raw(""))">
			<a href="@TopicLink(topic)" class="pf-indicator-list-link">
				@Html.TopicReadIndicator(topic, Model, "/Content/PopForums/", "pf-indicator")
				<span class="pf-heading">@topic.Title</span>
				<span class="pf-subhead">@PopForums.Resources.Last: @FormatTime(topic.LastPostTime) @PopForums.Resources.By @topic.LastPostName</span>
			</a>
		</li>
	}
</ul>